package cn.lcl.bean;

import java.util.List;

/**
 * 分页bean
 * Created by licho on 2017/8/17 0017.
 */
public class PageBean<T>{
    private Integer pageIndex;//页码
    private Integer pageSize;//每页大小
    private Integer totalPages;//总页数
    private  Integer totalRecords;//总记录数
    private List<T> data;//分页的数据

    public PageBean(Integer pageIndex, Integer pageSize,Integer totalRecords, List data) {
        this.pageIndex = pageIndex;
        this.pageSize = pageSize;
        this.totalRecords = totalRecords;
        this.totalPages=totalRecords/pageSize+1;
        this.data = data;
    }

    public Integer getPageIndex() {
        return pageIndex;
    }

    public void setPageIndex(Integer pageIndex) {
        this.pageIndex = pageIndex;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public Integer getTotalPages() {
        return totalPages;
    }

    public void setTotalPages(Integer totalPages) {
        this.totalPages = totalPages;
    }

    public Integer getTotalRecords() {
        return totalRecords;
    }

    public void setTotalRecords(Integer totalRecords) {
        this.totalRecords = totalRecords;
    }

    public List getData() {
        return data;
    }

    public void setData(List data) {
        this.data = data;
    }
}
